#ifndef ENGINELOGIN_HPP
#define ENGINELOGIN_HPP

#if (_MSC_VER >= 1300)
#pragma once
#endif // (_MSC_VER >= 1300)

#include <string>
#include <ctime>

#include "LogHandler.hpp"

class EngineLogin : public CLogHandler
	{
	public:
		EngineLogin(std::string const & file_name)
			: CLogHandler(file_name)
			{
			m_ptrFile->write("<?xml-stylesheet type=\"text/xsl\" href=\"stylesheet.xsl\" ?>\n\n");
			add_comment("Sistema de log del engine.");
			}

		virtual ~EngineLogin() {}

		template <typename T>
		void write_log(std::string const & class_name, 
			std::string const & function_name, 
			std::string const & debug_type, 
			T const& info, 
			std::string const& file, 
			const long line)
			{
			std::time_t time(std::time(NULL));

			add_tag_tree("LogEntry");
			add_tag("Class", class_name);
			add_tag("Function", function_name);
			add_tag("DebugType", debug_type);
			add_tag("Timestamp", std::ctime(&time));
			add_tag<T>("Info", info);
			add_tag("Line", line);
			add_tag("File", file);
			close_tag_tree(); // LogEntry
			}
	};

#endif // ENGINELOGIN_HPP